@extends('layouts.app')

@section('content')
    <div class="container">
        <div class="row">
            <div class="col-md-10 col-md-offset-1">
                <blockquote>
                    <p>资源进程展示页</p>

                </blockquote>
                <div class="panel panel-default">
                    <div class="panel-heading">资源进程展示页
                        <a  href="{{url('process/create')}}">添加</a>
                    </div>
                    @if (count($errors) > 0)
                        <div class="alert alert-danger">
                            <ul>
                                @foreach ($errors->all() as $error)
                                    <li>{{ $error }}</li>
                                @endforeach
                            </ul>
                        </div>
                    @endif
                    @if(session('message')!=null)
                        <div class="alert alert-success">
                            <ul>
                                <li>{{ session('message') }}</li>
                            </ul>
                        </div>
                    @endif
                    <table class="table table-hover">
                        <tr>
                            <td class="success">进程id</td>
                            <td class="success">父级id</td>
                            <td class="success">进程名</td>
                            <td class="success">排序</td>
                            <td class="success">
                                操作
                            </td>
                        </tr>
                        @foreach($processes as $process)
                            <tr>
                                <td class="active">{{$process['id']}}</td>
                                <td class="active">{{$process['pid']}}</td>
                                <td class="active">{{$process['_name']}}</td>
                                <td class="active">{{$process['sort']}}</td>
                                <td class="active">
                                    <a href="{{url('process')}}/{{$process['id']}}/edit" class="btn btn-info">编辑</a>
                                    <form action="{{ URL('process/'.$process['id']) }}" method="POST" style="display: inline;">
                                        <input name="_method" type="hidden" value="DELETE">
                                        <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                        <button type="submit" class="btn btn-primary">删除</button>
                                    </form>
                                </td>
                            </tr>
                        @endforeach

                        @if(count($processes)==0)
                            <tr>
                                <td>暂时没有进程信息</td>
                            </tr>
                        @endif
                    </table>
                </div>
            </div>
        </div>
    </div>
@endsection